using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEngine;

public class Console
{
    public static bool OpenLog;
    public static ConsoleColor ForegroundColor { get; internal set; }
    public static int CursorLeft { get; internal set; }

    public static Stream stream;

    internal static Stream OpenStandardInput()
    {
        if (stream != null)
            return stream;
        return stream=File.Create("log.txt");
    }

    internal static Stream OpenStandardOutput()
    {
        return OpenStandardInput();
    }

    internal static Stream OpenStandardError()
    {
        return OpenStandardInput();
    }

    internal static void WriteWarningLine(string message = "/n")
    {
        if (OpenLog)
            Debug.LogWarning(message);
    }

    internal static void WriteLine(string message="/n")
    {
        if (OpenLog)
            Debug.Log(message);
    }

    internal static void WriteLine(int message)
    {
        if (OpenLog)
            Debug.Log(message);
    }

    internal static void Write(object v)
    {
        
    }

    internal static void Dispose()
    {
        stream?.Dispose();
    }
}
